﻿
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using ZX.BLL.Extend;
using ZX.DBModule;
using ZX.EHR.Library;
using ZX.SYS.Bussiness.Message;
using ZX.Web.UI.Controls;
namespace ZX.WebApp
{
    /// <summary>
    /// 主页面处理类
    /// </summary>
    public partial class Welcome : BasePage
    {
        protected int numLeast,numAttach, numHd, numNotice;
        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {
                bind();  
            }
        }

        //获取各模块列表
        private void bind()
        {
            //待办事宜
            Guid? gd = this.UserId;
 
            //待办事宜
            rptUnBegin.DataSource = new BMessageItem().GetReceiverSysMessages(8, gd.ToString());
            rptUnBegin.DataBind();
            numLeast = rptUnBegin.Items.Count;
            ////获取知识列表
            //BTrAttach bta = new BTrAttach();
            //IList<V_TrCourse> iVtcList = bta.getAttachList(8);
            //rptFile.DataSource = iVtcList;
            //rptFile.DataBind();
            //numAttach = rptFile.Items.Count;
            ////最新公告列表
            //IList<V_TrMessageIssue> vtmilm = bta.getAttachList(8, "公告");
            //rptnotice.DataSource = vtmilm;
            //rptnotice.DataBind();
            //numNotice = rptnotice.Items.Count;
            ////最新互动列表
            //IList<V_TrMessageIssue> vtmilh = bta.getAttachList(8, "互动");
            //rptHudong.DataSource = vtmilh;
            //rptHudong.DataBind();
            //numHd = rptHudong.Items.Count;
        }

       

        public string GetStr(object obj)
        {
            string re = "";
            if (obj != null)
            {
                if (obj.ToString().Length > 20)
                {
                    re = obj.ToString().Substring(0, 20) + "...";
                }
                else
                {
                    re = obj.ToString();
                }
            }
            return re;
        }
    }
}
